set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_STANDARD 99)
set(CMAKE_CROSSCOMPILING TRUE)
set(CMAKE_BUILD_TYPE "Debug")

set(CMAKE_C_COMPILER_ID GNU)
set(CMAKE_CXX_COMPILER_ID GNU)
set(CMAKE_FIND_ROOT_PATH "/opt/arm-anykav500-crosstool/arm-anykav500-linux-uclibcgnueabi/sysroot")
set(CMAKE_SYSROOT "/opt/arm-anykav500-crosstool/arm-anykav500-linux-uclibcgnueabi/sysroot")
set(CMAKE_ASM_COMPILER "/opt/arm-anykav500-crosstool/bin/arm-anykav500-linux-uclibcgnueabi-as")
set(CMAKE_AR "/opt/arm-anykav500-crosstool/bin/arm-anykav500-linux-uclibcgnueabi-ar")
set(CMAKE_C_COMPILER "/opt/arm-anykav500-crosstool/bin/arm-anykav500-linux-uclibcgnueabi-gcc")
set(CMAKE_CXX_COMPILER "/opt/arm-anykav500-crosstool/bin/arm-anykav500-linux-uclibcgnueabi-g++")

set(CMAKE_C_FLAGS_INIT "-g -Werror -D_GNU_SOURCE -std=c99 -mlittle-endian -fno-builtin -mlong-calls")
set(CMAKE_ASM_FLAGS_INIT "-mlittle-endian -x assembler-with-cpp")

set(LINK_DIR "/home/jack/sdk_release_dir/platform/lib")
set(LINK_INC "/home/jack/sdk_release_dir/platform/include")
set(LINK_LIBS plat_common plat_mem plat_thread plat_log plat_osal plat_drv plat_dbg)
set(CMAKE_LIBRARY_PATH "/usr/lib" "/lib")

set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

if(${CMAKE_BUILD_TYPE} EQUAL "Debug")
    set(CMAKE_C_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} -g")
    set(CMAKE_ASM_FLAGS_INIT "${CMAKE_ASM_FLAGS_INIT} -g")
endif()

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
